]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Restore intended OSK visibility behavior
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 18 Jan 2018 17:56:10 +0000 (18:56 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 5 Feb 2018 16:46:57 +0000 (17:46 +0100)
Getting the necessary "setting enabled, or input from touchscreen"
conditions to have the OSK shown are not enough on the lack of a
current focus. As we are setting up the caret tracker here, wait for
the focus in event before showing the keyboard.

This fixes 2 issues, with the setting disabled it became really hard
to get the OSK hidden on eg. touchscreen->pointer device switches,
as visibility only depended on the a11y setting here. And secondly,
enabling the setting would always end up with the OSK being shown
regardless of focus, while it should stay hidden if there's no text
edition.

https://bugzilla.gnome.org/show_bug.cgi?id=788188

js/ui/keyboard.js

index 1a251b582316572aeb74aa95f51cc10bf2683ee2..77c44f8c7f98c8eb5fb8bf7bdfabdd387cc3d856 100644 (file)
@@ -308,7 +308,7 @@ var Keyboard = new Lang.Class({
     },
 
     _syncEnabled: function () {
-        let wasEnabled = this._enableKeyboard;
+        let wasEnabled = this._enabled;
         this._enableKeyboard = this._a11yApplicationsSettings.get_boolean(SHOW_KEYBOARD);
         this._enabled = this._enableKeyboard || this._lastDeviceIsTouchscreen();
         if (!this._enabled && !this._keyboard)
@@ -319,9 +319,7 @@ var Keyboard = new Lang.Class({
         if (this._enabled && !this._keyboard)
             this._setupKeyboard();
 
-        if (this._enableKeyboard && !wasEnabled)
-            Main.layoutManager.showKeyboard();
-        else if (!this._enableKeyboard && wasEnabled)
+        if (!this._enabled && wasEnabled)
             Main.layoutManager.hideKeyboard(true);
     },